package com.lu.service.floor;

import com.lu.entity.Floor;
import com.lu.mapper.FloorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class FloorService implements FloorServices{
    @Autowired
    private FloorMapper floorMapper;

    //查询楼的所有数据
    @Override
    public List<Floor> getFloors() {
        return floorMapper.selectFloorAll();
    }

    //根据id删除数据
    @Override
    public void deleteFloor(Integer id) {
        floorMapper.deleteFloor(id);
    }

    //根据id查询数据
    @Override
    public List<Floor> getFloorsByid(Integer id) {
        return floorMapper.selectFloorById(id);
    }

    //修改楼宇的数据
    @Override
    public void updateFloor(Floor floor) {
        floorMapper.updateFloor(floor);
    }

    //模糊查询
    @Override
    public List<Floor> getFloorsByBuilName(Floor floor) {
        return floorMapper.selectFloor(floor);
    }

    //添加楼宇数据
    @Override
    public void insertFloor(Floor floor) {
        floorMapper.insertFloor(floor);
    }

}
